package org.lg.configure;

import org.lg.factory.YamlAndPropertySourceFactory;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.PropertySource;
import org.springframework.stereotype.Component;

@Component //被spring扫描处理
@ConfigurationProperties(prefix = "lg.server",ignoreUnknownFields = false)
//PropertySource property的位置
@PropertySource(factory = YamlAndPropertySourceFactory.class,value = {"classpath:my.yml"}) //yml版 读取的是引用这个项目的 项目的yml配置而不是当前项目的

//@PropertySource("classpath:application.properties") //properties版
//ConfigurationProperties 配置详细配置 prefix前缀

public class LgServerProperties  {
    private static Integer port;
    //private String context;

    public static Integer getPort() {
        return port;
    }

    public  void setPort(Integer port) {
        this.port = port;
    }

//    public String getContext() {
//        return context;
//    }
//
//    public void setContext(String context) {
//        this.context = context;
//    }
}
